package YHSJ;

import java.util.ArrayList;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: adol book
 * Date: 2022-04-26
 * Time: 9:10
 */
public class demo {
    public static List<Character> fun(String s1, String s2) {
        if(s1 == null || s2 == null){
            return null;
        }
        if(s1.length() == 0 || s2.length() == 0){
            return null;
        }
        List<Character> tem = new ArrayList<>();
        for (int i = 0; i < s1.length(); i++) { // 遍历数组
            char t = s1.charAt(i); //获取数组下标
            if (!s2.contains(t + "")) {
                tem.add(t);
            }
        }
        return tem;
    }

    public static void main(String[] args) {
        String s1 = "welcome to bit";
        String s2 = "come";
        List<Character> func = fun(s1,s2);
        System.out.println(func);
        System.out.println("=======");
        for (char ch : func) {
            System.out.print(ch);
        }
        System.out.println();
    }

    public static ArrayList<List<Integer>> gneorow(int numRow) { //二位数组
        ArrayList<List<Integer>> tem = new ArrayList<>();
        List<Integer> frist = new ArrayList<>(); //第一行
        List<Integer> next = new ArrayList<>(); //下一行
        frist.add(1); //添加第一行
        tem.add(frist);
        for (int i = 1; i < numRow; i++) { //i表示行
            next.add(1);
            for (int j = 0; j < i; j++) { //j表示列
                // [i][j] = [i-1][j] + [i-1][j-1]
                List<Integer> pernow = tem.get(i - 1);//[i-1]行
                int t = pernow.get(j) + pernow.get(j - 1);
                next.add(t);
            }
            // i行数 = j行数时
            next.add(1);
            tem.add(next);
        }
        return tem;
    }
}

